import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// import './style.css'
import App from './App.vue'
import { router } from './router'
import * as EelementPlusIconsVue from '@element-plus/icons-vue'
import store from '~/store'
import installFilter from '~/filters'

const app = createApp(App)
app.use(store)
app.use(router)
app.use(ElementPlus)

// 引入所有图标
for(const [key,component] of Object.entries(EelementPlusIconsVue)){
  app.component(key,component)
}

import 'virtual:windi.css'
import './permission'
import 'nprogress/nprogress.css'

// #region 记载自定义指令
import permission from '~/directives/permission.js'
app.use(permission)
// #endregion

// vue-toastification
import vtfToast from "vue-toastification";
import "vue-toastification/dist/index.css";
const vtfToastOptions = {
  position: "top-right",
  timeout: 4000,
  closeOnClick: true,
  pauseOnFocusLoss: true,
  pauseOnHover: true,
  draggable: true,
  draggablePercent: 0.6,
  showCloseButtonOnHover: false,
  hideProgressBar: false,
  closeButton: "button",
  icon: true,
  rtl: false
};
app.use(vtfToast, vtfToastOptions);
installFilter(app)

app.mount('#app')
